package com.wash.shoes.request;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.model.BaseModel;
import com.wash.shoes.common.enums.FactoryServiceTypeEnum;
import com.wash.shoes.common.enums.FactoryStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;

@Data
public class FactoryQueryRequest extends BaseModel {
    @ApiModelProperty(value = "工厂名称")
    private String factoryName;
    @ApiModelProperty(value = "工厂管理员")
    private String factoryManager;
    @ApiModelProperty(value = "工厂服务类型")
    private FactoryServiceTypeEnum factoryServiceType;


    /**
     * 工厂状态
     */
    @ApiModelProperty(value = "工厂状态")
    private FactoryStatusEnum status;

    @ApiModelProperty(value = "页码")
    @Min(value = 1, message = "页码不能小于1")
    protected int pageNo = 1;
    @ApiModelProperty(value = "每页数量")
    @Min(value = 1, message = "每页数量不能小于1")
//    @Max(value = 100, message = "每页数量不能大于100")
    protected int pageSize = 20;


    public IPage toPage() {
        return new Page<>(pageNo, pageSize);
    }
}